Path: blob/master/Part 9 - Dimension Reduction/Principal Component Analysis/[R] Principal Component Analysis.ipynb
1341 views
Kernel: R
Principal Component Analysis
Data preprocessing
In [1]:
In [2]:
Out[2]:
In [3]:
In [4]:
Out[4]:
In [5]:
Out[5]:
In [6]:
In [7]:
Out[7]:
In [8]:
Out[8]:
Applying Principal Component Analysis
In [9]:
Out[9]:
Loading required package: lattice
Loading required package: ggplot2
In [10]:
In [11]:
Out[11]:
In [12]:
In [13]:
Out[13]:
In [14]:
In [15]:
Out[15]:
Fitting classifier to the Training set
In [16]:
Predicting the Test set results
In [17]:
In [18]:
Out[18]:
In [19]:
Out[19]:
Making the Confusion Matrix
In [20]:
In [21]:
Out[21]:
y_pred
1 2 3
1 11 1 0
2 0 14 0
3 0 0 10
classifier made 11 + 14 + 10 = 35 correct prediction and 1 incoreect prediction.
Visualizing the Training set results
In [22]:
In [23]:
In [24]:
Out[24]:
Visualizing the Test set results
In [25]:
In [26]:
Out[26]: